﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Fluent="clr-namespace:Fluent">
  <Style TargetType="{x:Type Fluent:Button}" x:Key="ButtonBackstageStyle">
  	<Setter Property="Template" Value="{DynamicResource ButtonBackstageControlTemplate}"/>
    
  </Style>
  <ControlTemplate x:Key="ButtonBackstageControlTemplate" TargetType="{x:Type Fluent:Button}">
  	<Grid x:Name="grid" Width="81" Height="85">
  		<Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{DynamicResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0"/>
  		<Border x:Name="border" BorderThickness="1" CornerRadius="3" Margin="0,0,0,1" BorderBrush="{DynamicResource ButtonBackstageOutterBorderBrush}">
  			<Border x:Name="border1" BorderBrush="Black" BorderThickness="0" CornerRadius="2" Background="{DynamicResource ButtonBackstageInnerBackgroundBrush}">
  				<StackPanel Margin="2" x:Name="stackPanel">
  					<Image x:Name="image" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="9,9,9,0" Source="{TemplateBinding LargeIcon}"/>
  					<Fluent:TwoLineLabel x:Name="twoLineLabel" Margin="7,7,7,5" VerticalAlignment="Center" Text="{TemplateBinding Text}"/>
  				</StackPanel>
  			</Border>
  		</Border>
  	</Grid>
  	<ControlTemplate.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="image" Value="0.5"/>
        <Setter Property="Opacity" TargetName="twoLineLabel" Value="0.5"/>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect/>
          </Setter.Value>
        </Setter>
      </Trigger>
  		<Trigger Property="Size" Value="Small">
  			<Setter Property="Visibility" TargetName="image" Value="Collapsed"/>
  			<Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal"/>
  			<Setter Property="HorizontalAlignment" TargetName="stackPanel" Value="Center"/>
  			<Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center"/>
  			<Setter Property="Margin" TargetName="twoLineLabel" Value="2"/>
  			<Setter Property="Width" TargetName="grid" Value="Auto"/>
  			<Setter Property="Height" TargetName="grid" Value="Auto"/>
  			<Setter Property="HorizontalAlignment" TargetName="twoLineLabel" Value="Center"/>
  			<Setter Property="HasTwoLines" TargetName="twoLineLabel" Value="False"/>
  		</Trigger>
  		<Trigger Property="Size" Value="Middle">
  			<Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal"/>
  			<Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center"/>
  			<Setter Property="Margin" TargetName="twoLineLabel" Value="7,0"/>
  			<Setter Property="Margin" TargetName="image" Value="9,2,9,0"/>
  			<Setter Property="Width" TargetName="grid" Value="Auto"/>
  			<Setter Property="Height" TargetName="grid" Value="Auto"/>
  		</Trigger>
  		<Trigger Property="IsEnabled" Value="False">
  			<Setter Property="BorderBrush" TargetName="border" Value="#FFC8C8C9"/>
  			<Setter Property="Opacity" TargetName="rectangle" Value="0"/>
  			<Setter Property="Background" TargetName="border1">
  				<Setter.Value>
  					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  						<GradientStop Color="White" Offset="0.009"/>
  						<GradientStop Color="#FFFBFBFB" Offset="1"/>
  					</LinearGradientBrush>
  				</Setter.Value>
  			</Setter>
  		</Trigger>
  		<Trigger Property="IsMouseOver" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="BorderThickness" TargetName="border1" Value="1"/>
  			<Setter Property="Margin" TargetName="stackPanel" Value="1"/>
  		</Trigger>
  		<Trigger Property="IsFocused" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="BorderThickness" TargetName="border1" Value="1"/>
  			<Setter Property="Margin" TargetName="stackPanel" Value="1"/>
  		</Trigger>
  		<Trigger Property="IsPressed" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonPressedOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonPressedOuterBackgroundBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBorderBrush}"/>
  		</Trigger>
  	</ControlTemplate.Triggers>
  </ControlTemplate>
  <Style TargetType="{x:Type Fluent:DropDownButton}" x:Key="DropDownButtonBackstageStyle">
  	<Setter Property="Template" Value="{DynamicResource DropDownButtonBackstageControlTemplate}"/>
  	<Setter Property="Height" Value="81"/>
  	<Setter Property="Width" Value="85"/>
    
  </Style>
  <ControlTemplate x:Key="DropDownButtonBackstageControlTemplate" TargetType="{x:Type Fluent:DropDownButton}">
  	<Grid>
  		<Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{DynamicResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0"/>
  		<Border x:Name="border" BorderThickness="1" CornerRadius="3" Margin="0,0,0,1" BorderBrush="{DynamicResource ButtonBackstageOutterBorderBrush}">
  			<Border x:Name="border1" BorderBrush="Black" BorderThickness="0" CornerRadius="2" Background="{DynamicResource ButtonBackstageInnerBackgroundBrush}">
  				<StackPanel x:Name="stackPanel" Margin="2">
  					<Image Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="7,7,7,0" Source="{TemplateBinding LargeIcon}"/>
  					<Fluent:TwoLineLabel Margin="5,5,5,3" VerticalAlignment="Center" HasGlyph="True" Text="{TemplateBinding Text}"/>
  				</StackPanel>
  			</Border>
  		</Border>
  	</Grid>
  	<ControlTemplate.Triggers>
  		<Trigger Property="IsEnabled" Value="False">
  			<Setter Property="BorderBrush" TargetName="border" Value="#FFC8C8C9"/>
  			<Setter Property="Opacity" TargetName="rectangle" Value="0"/>
  			<Setter Property="Background" TargetName="border1">
  				<Setter.Value>
  					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  						<GradientStop Color="White" Offset="0.009"/>
  						<GradientStop Color="#FFFBFBFB" Offset="1"/>
  					</LinearGradientBrush>
  				</Setter.Value>
  			</Setter>
  		</Trigger>
  		<Trigger Property="IsMouseOver" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="BorderThickness" TargetName="border1" Value="1"/>
  			<Setter Property="Margin" TargetName="stackPanel" Value="1"/>
  		</Trigger>
  		<Trigger Property="IsFocused" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="BorderThickness" TargetName="border1" Value="1"/>
  			<Setter Property="Margin" TargetName="stackPanel" Value="1"/>
  		</Trigger>
  		<Trigger Property="IsOpen" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonPressedOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonPressedOuterBackgroundBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBorderBrush}"/>
  		</Trigger>
  	</ControlTemplate.Triggers>
  </ControlTemplate>
  
  <Style x:Key="GalleryItemBackstageStyle" TargetType="{x:Type Fluent:GalleryItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:GalleryItem}">
        
        	<Grid Background="{DynamicResource TransparentBrush}">
        		<Border x:Name="hoverBorder" BorderBrush="{DynamicResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{DynamicResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
        			<Border Height="Auto" BorderBrush="{DynamicResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
        		</Border>
        		<Border x:Name="selectedBorder" BorderBrush="#FFF29536" BorderThickness="1" CornerRadius="2" Background="#FFFCF1C2" Visibility="Collapsed" Width="40" Height="38" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="1,0,0,0"/>
        		<ContentPresenter x:Name="contentPresenter" Margin="1" Opacity="1"/>
        		<Border x:Name="pressedBorder" BorderBrush="{DynamicResource ButtonPressedOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{DynamicResource ButtonPressedOuterBackgroundBrush}" Visibility="Collapsed" Opacity="0.5">
        			<Border Height="Auto" BorderBrush="{DynamicResource ButtonPressedInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{DynamicResource ButtonPressedInnerBackgroundBrush}"/>
        		</Border>
        	</Grid>
        	<ControlTemplate.Triggers>
        		<Trigger Property="IsEnabled" Value="False">
        			<Setter Property="Opacity" TargetName="contentPresenter" Value="0.5"/>
        		</Trigger>
        		<Trigger Property="IsSelected" Value="True">
        			<Setter Property="Visibility" TargetName="selectedBorder" Value="Visible"/>
        		</Trigger>
        		<Trigger Property="IsMouseOver" Value="True">
        			<Setter Property="Visibility" TargetName="hoverBorder" Value="Visible"/>
        		</Trigger>
        	</ControlTemplate.Triggers>
        
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Width" Value="{Binding ItemWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonItemsControl}}}"/>
    <Setter Property="Height" Value="{Binding ItemHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonItemsControl}}}"/>
	<Setter Property="FocusVisualStyle" Value="{DynamicResource ControlStyleEmptyFocus}"/>
  </Style>
  
  <Style TargetType="{x:Type Fluent:ComboBox}" x:Key="ComboBoxBackstageStyle">
  	<Setter Property="Template" Value="{DynamicResource ComboBoxBackstageControlTemplate}"/>
  	<Setter Property="Height" Value="42"/>
  	<Setter Property="Width" Value="229"/>
  	<Setter Property="IsReadOnly" Value="True"/>
  	<Setter Property="IsEditable" Value="False"/>
  	<Setter Property="ItemHeight" Value="40"/>
    
  </Style>
  <ControlTemplate x:Key="ComboBoxBackstageControlTemplate" TargetType="{x:Type Fluent:ComboBox}">
  	<ControlTemplate.Resources>
  		 	<Style BasedOn="{StaticResource GalleryItemBackstageStyle}" TargetType="{x:Type Fluent:GalleryItem}"/>
	</ControlTemplate.Resources>
  	<Grid>
  		<Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{DynamicResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0"/>
  		<Border x:Name="PART_ContentBorder" BorderThickness="1" CornerRadius="3" Margin="0,0,0,1" BorderBrush="{DynamicResource ButtonBackstageOutterBorderBrush}">
  			<Border x:Name="border1" BorderBrush="Black" BorderThickness="0" CornerRadius="2" Background="{DynamicResource ButtonBackstageInnerBackgroundBrush}">
  				<Grid x:Name="stackPanel" Margin="2">
  					<Grid.ColumnDefinitions>
  						<ColumnDefinition Width="*"/>
  						<ColumnDefinition Width="22"/>
  					</Grid.ColumnDefinitions>
  					<TextBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Text="{TemplateBinding SelectedItem}" TextWrapping="NoWrap" BorderThickness="0,0,0,0" x:Name="PART_TextBox" IsReadOnly="{TemplateBinding IsReadOnly}" Background="{DynamicResource TextBoxBackgroundBrush}" Grid.ColumnSpan="1"/>
      				<Fluent:GalleryItem x:Name="PART_GalleryItem" Margin="0" Content="" Grid.ColumnSpan="1" Visibility="Collapsed" IsHitTestVisible="False" Focusable="False"/>
      				<Image x:Name="PART_FakeImage" Grid.ColumnSpan="1" Visibility="Collapsed" IsHitTestVisible="False" Stretch="None"/>
					<Path x:Name="path" HorizontalAlignment="Center" Margin="0,0,0,0" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" Data="M0,0L1,1 2,0z" Fill="#FF000000" Width="7" Height="4" VerticalAlignment="Center" Grid.Column="1"/>
  				</Grid>
  			</Border>
  		</Border>
  	</Grid>
  	<ControlTemplate.Triggers>
  		<Trigger Property="IsEnabled" Value="False">
  			<Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="#FFC8C8C9"/>
  			<Setter Property="Opacity" TargetName="rectangle" Value="0"/>
  			<Setter Property="Background" TargetName="border1">
  				<Setter.Value>
  					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  						<GradientStop Color="White" Offset="0.009"/>
  						<GradientStop Color="#FFFBFBFB" Offset="1"/>
  					</LinearGradientBrush>
  				</Setter.Value>
  			</Setter>
  		</Trigger>
  		<Trigger Property="IsMouseOver" Value="True">
  			<Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="PART_ContentBorder" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="BorderThickness" TargetName="border1" Value="1"/>
  			<Setter Property="Margin" TargetName="stackPanel" Value="1"/>
  		</Trigger>
  		<Trigger Property="IsFocused" Value="True">
  			<Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="PART_ContentBorder" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="BorderThickness" TargetName="border1" Value="1"/>
  			<Setter Property="Margin" TargetName="stackPanel" Value="1"/>
  		</Trigger>
  		<Trigger Property="IsOpen" Value="True">
  			<Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{DynamicResource ButtonPressedOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="PART_ContentBorder" Value="{DynamicResource ButtonPressedOuterBackgroundBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBorderBrush}"/>
  		</Trigger>
		<Trigger Property="IsEditable" Value="False">
        			<Setter Property="Visibility" TargetName="PART_GalleryItem" Value="Visible"/>
        			<Setter Property="Visibility" TargetName="PART_TextBox" Value="Collapsed"/>
        </Trigger>
  	</ControlTemplate.Triggers>
  </ControlTemplate>
  
  <!--Button in Spinner Control Style-->
  <ControlTemplate x:Key="SpinnerButtonBackstageControlTemplate" TargetType="{x:Type RepeatButton}">
		<Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{DynamicResource TransparentBrush}" BorderBrush="{DynamicResource TransparentBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
			<Border x:Name="border1" Height="Auto" BorderBrush="{DynamicResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{DynamicResource TransparentBrush}">
				<Grid Height="Auto">
					<Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
						<Rectangle.Fill>
							<RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
								<GradientStop Color="#7FFFFFFF" Offset="0"/>
								<GradientStop Offset="1"/>
							</RadialGradientBrush>
						</Rectangle.Fill>
					</Rectangle>
						<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center"/>
				</Grid>
			</Border>
		</Border>
		<ControlTemplate.Triggers>
  		<Trigger Property="Border.BorderThickness" Value="0,1,0,0">
  			<Setter Property="CornerRadius" TargetName="border" Value="0,2,0,0"/>
  			<Setter Property="CornerRadius" TargetName="border1" Value="0,1,0,0"/>
  		</Trigger>
  		<Trigger Property="Border.BorderThickness" Value="0,0,1,0">
  			<Setter Property="CornerRadius" TargetName="border" Value="0,0,3,0"/>
  			<Setter Property="CornerRadius" TargetName="border1" Value="0,0,2,0"/>
  		</Trigger>
  		<Trigger Property="IsMouseOver" Value="False"/>			
  		<Trigger Property="IsPressed" Value="True">
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonPressedOuterBorderBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonPressedOuterBackgroundBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBorderBrush}"/>
  		</Trigger>
  		<Trigger Property="IsEnabled" Value="False">
  			<Setter Property="Opacity" TargetName="contentPresenter" Value="0.5"/>
  		</Trigger>
  		<MultiTrigger>
  			<MultiTrigger.Conditions>
  				<Condition Property="IsMouseOver" Value="True"/>
  				<Condition Property="IsPressed" Value="False"/>
  			</MultiTrigger.Conditions>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  			<Setter Property="Visibility" TargetName="rectangle" Value="Visible"/>
  		</MultiTrigger>
  		<MultiTrigger>
  			<MultiTrigger.Conditions>
  				<Condition Property="IsKeyboardFocusWithin" Value="True"/>
  				<Condition Property="IsPressed" Value="False"/>
  			</MultiTrigger.Conditions>
  			<Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
  			<Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>
  			<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonHoverOuterBackgroundBrush}"/>
  			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
  		</MultiTrigger>
  	</ControlTemplate.Triggers>
	</ControlTemplate>
  <Style x:Key="SpinnerButtonBackstageStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="Template" Value="{StaticResource SpinnerButtonBackstageControlTemplate}"/>
    <Setter Property="Foreground" Value="{DynamicResource DefaultFontBrush}"/>
    <Setter Property="FocusVisualStyle" Value="{DynamicResource ControlStyleEmptyFocus}"/>
  </Style>    
  
  
  <!--Spinner Style-->
  <Style x:Key="SpinnerBackstageStyle" TargetType="{x:Type Fluent:Spinner}">
    <Setter Property="FocusVisualStyle" Value="{DynamicResource ControlStyleEmptyFocus}"/>
    <Setter Property="Foreground" Value="{DynamicResource DefaultFontBrush}"/>
    <Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}"/>
    <Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:Spinner}">
          
            <Grid Width="Auto" Height="22" Background="#00000000">
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition Width="Auto"/>
            		<ColumnDefinition Width="*"/>
            	</Grid.ColumnDefinitions>
            	<StackPanel Orientation="Horizontal" Grid.ColumnSpan="1" x:Name="stackPanel" HorizontalAlignment="Left" Margin="0">
            		<Image Width="16" Height="16" VerticalAlignment="Center" Margin="4,0,3,0" Source="{TemplateBinding Icon}"/>
            		<TextBlock Text="{TemplateBinding Text}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="2,0,4,0" x:Name="textBlock"/>
            	</StackPanel>
				
              <Border x:Name="border" Height="22" BorderThickness="1" Background="{DynamicResource TextBoxBackgroundBrush}" Grid.ColumnSpan="1" Grid.Column="1" Width="{TemplateBinding InputWidth}" CornerRadius="2">
              	<Border.BorderBrush>
              		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              			<GradientStop Color="#FFABAFB2" Offset="0"/>
              			<GradientStop Color="#FFE1E6EC" Offset="1"/>
              		</LinearGradientBrush>
              	</Border.BorderBrush>
            	<Grid Grid.ColumnSpan="1" Grid.Column="1">
            		<Grid.ColumnDefinitions>
            			<ColumnDefinition Width="*"/>
            			<ColumnDefinition Width="17"/>
            		</Grid.ColumnDefinitions>
            		<Grid.RowDefinitions>
            			<RowDefinition Height="*"/>
            			<RowDefinition Height="*"/>
            		</Grid.RowDefinitions>

            		<TextBox x:Name="PART_TextBox" BorderThickness="0" Grid.RowSpan="2" Grid.Column="0" Background="{DynamicResource TextBoxBackgroundBrush}" Margin="1,0,0,0" Padding="1"/>
            		<Border x:Name="border1" BorderBrush="#FFBEC1C4" BorderThickness="1" Margin="0,-1,-1,0" Grid.RowSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="0,2,0,0" Grid.Column="1" Visibility="Collapsed">
            			<Border.Background>
            				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            					<GradientStop Color="White" Offset="0"/>
            					<GradientStop Color="#FFF1F2F2" Offset="1"/>
            				</LinearGradientBrush>
            			</Border.Background>
            		</Border>
            		<Border x:Name="border2" BorderBrush="#FFBEC1C4" BorderThickness="1" Grid.ColumnSpan="1" Margin="0,-1,-1,-1" Grid.RowSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="18" CornerRadius="0,0,2,0" Grid.Column="1" Grid.Row="1" Visibility="Collapsed">
            			<Border.Background>
            				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            					<GradientStop Color="White" Offset="0"/>
            					<GradientStop Color="#FFF1F2F2" Offset="1"/>
            				</LinearGradientBrush>
            			</Border.Background>
            		</Border>
            		<RepeatButton x:Name="PART_ButtonUp" Grid.Column="1" Grid.Row="0" Style="{StaticResource SpinnerButtonBackstageStyle}" RenderTransformOrigin="0,0.5" HorizontalAlignment="Stretch" BorderThickness="0,1,0,0" Margin="0,-1,-1,0">
            			<Path Width="7" Height="4" Fill="#FF757778" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,-1 2,0" HorizontalAlignment="Center" StrokeThickness="0" VerticalAlignment="Center" Margin="1,1,0,1"  RenderOptions.EdgeMode="Aliased"/>
            		</RepeatButton>
            		<RepeatButton x:Name="PART_ButtonDown" Grid.Column="1" Grid.Row="1" Style="{StaticResource SpinnerButtonBackstageStyle}" BorderThickness="0,0,1,0" Margin="0,0,-1,-1" >
            			<Path Width="7" Height="4" Fill="#FF757778" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,1 2,0" StrokeThickness="0" HorizontalAlignment="Center" Margin="1,0,0,0" VerticalAlignment="Center" RenderOptions.EdgeMode="Aliased"/>
            		</RepeatButton>
            	</Grid>
				</Border>
          	</Grid>
          
        	<ControlTemplate.Triggers>
        		
        		<Trigger Property="IsEnabled" Value="False">
        			<Setter Property="IsEnabled" TargetName="PART_TextBox" Value="False"/>
        			<Setter Property="Background" TargetName="border" Value="{DynamicResource TextBoxDisabledBackgroundBrush}"/>
        			<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource TextBoxDisabledBorderBrush}"/>
        			<Setter Property="Background" TargetName="PART_TextBox" Value="{DynamicResource TextBoxDisabledBackgroundBrush}"/>
        		</Trigger>
        		<Trigger Property="Size" Value="Middle">
        			<Setter Property="Visibility" TargetName="textBlock" Value="Collapsed"/>
        		</Trigger>
        		<Trigger Property="Size" Value="Small">
        			<Setter Property="Visibility" TargetName="stackPanel" Value="Collapsed"/>
        		</Trigger>
        		<Trigger Property="IsMouseOver" Value="True">
        			<Setter Property="Background" TargetName="border" Value="{DynamicResource TextBoxHoverBackgroundBrush}"/>
        			<Setter Property="Background" TargetName="PART_TextBox" Value="{DynamicResource TextBoxHoverBackgroundBrush}"/>
        			<Setter Property="BorderBrush" TargetName="border">
        				<Setter.Value>
        					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        						<GradientStop Color="#FFCFAF5A" Offset="0"/>
        						<GradientStop Color="#FFEFDA71" Offset="1"/>
        					</LinearGradientBrush>
        				</Setter.Value>
        			</Setter>
        			<Setter Property="Visibility" TargetName="border1" Value="Visible"/>
        			<Setter Property="Visibility" TargetName="border2" Value="Visible"/>
        			<Setter Property="BorderBrush" TargetName="border1" Value="#E5BEC1C4"/>
        			<Setter Property="BorderBrush" TargetName="border2" Value="#E5BEC1C4"/>
        		</Trigger>
				<Trigger Property="IsFocused" Value="True" SourceName="PART_TextBox">
        			<Setter Property="Background" TargetName="border" Value="{DynamicResource TextBoxHoverBackgroundBrush}"/>
        			<Setter Property="Background" TargetName="PART_TextBox" Value="{DynamicResource TextBoxHoverBackgroundBrush}"/>
        			<Setter Property="BorderBrush" TargetName="border">
        				<Setter.Value>
        					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        						<GradientStop Color="#FFCFAF5A" Offset="0"/>
        						<GradientStop Color="#FFEFDA71" Offset="1"/>
        					</LinearGradientBrush>
        				</Setter.Value>
        			</Setter>
        			<Setter Property="Visibility" TargetName="border1" Value="Visible"/>
        			<Setter Property="Visibility" TargetName="border2" Value="Visible"/>
        			<Setter Property="BorderBrush" TargetName="border1" Value="#E5BEC1C4"/>
        			<Setter Property="BorderBrush" TargetName="border2" Value="#E5BEC1C4"/>
        		</Trigger>
        	</ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>